home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
os2
/
remin301.zip
/
REMIN300.ZIP
/
TYPES.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-10
|
4KB
|
157 lines
/***************************************************************/
/* */
/* TYPES.H */
/* */
/* Type definitions all dumped here. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
/* Values */
typedef struct {
char type;
union {
char *str;
int val;
} v;
} Value;
/* Define the type of operators */
typedef struct {
char *name;
char prec;
char type;
#ifdef HAVE_PROTOS
int (*func)(void);
#else
int (*func) ();
#endif
} Operator;
/* Define the structure of a variable */
typedef struct var {
struct var *next;
char name[VAR_NAME_LEN+1];
char preserve;
Value v;
} Var;
/* A trigger */
typedef struct {
int wd;
int d;
int m;
int y;
int back;
int delta;
int rep;
int localomit;
int skip;
int until;
int typ;
int once;
} Trigger;
/* A time trigger */
typedef struct {
int ttime;
int nexttime;
int delta;
int rep;
} TimeTrig;
/* The parse pointer */
typedef struct {
char isnested; /* Is it a nested expression? */
char allownested;
char *text; /* Start of text */
char *pos; /* Current position */
char *etext; /* Substituted text */
char *epos; /* Position in substituted text */
} Parser;
typedef Parser *ParsePtr; /* Pointer to parser structure */
/* Some useful manifest constants */
#define NO_BACK 0
#define NO_DELTA 0
#define NO_REP 0
#define NO_WD 0
#define NO_DAY -1
#define NO_MON -1
#define NO_YR -1
#define NO_UNTIL -1
#define NO_ONCE 0
#define ONCE_ONCE 1
#define NO_SKIP 0
#define SKIP_SKIP 1
#define BEFORE_SKIP 2
#define AFTER_SKIP 3
#define NO_TIME 1500 /* >1440, ie > than the largest possible legal time */
#define NO_TYPE 0
#define MSG_TYPE 1
#define RUN_TYPE 2
#define CAL_TYPE 3
#define SAT_TYPE 4
/* DEFINES for debugging flags */
#define DB_PRTLINE 1
#define DB_PRTEXPR 2
#define DB_PRTTRIG 4
#define DB_DUMP_VARS 8
#define DB_ECHO_LINE 16
/* Enumeration of the tokens */
enum TokTypes
{ T_Illegal,
/* Commands first */
T_Rem, T_Push, T_Pop, T_Preserve, T_Include, T_If, T_Else, T_EndIf,
T_IfTrig, T_ErrMsg,
T_Set, T_UnSet, T_Fset, T_Omit, T_Banner, T_Exit,
T_WkDay,
T_Month, T_Time,
T_Skip, T_At, T_RemType, T_Until, T_Year, T_Day, T_Rep, T_Delta, T_Back,
T_Once,
T_Empty,
T_Comment,
T_Number,
T_Clr,
T_Debug,
T_Dumpvars
};
/* The structure of a token */
typedef struct {
char *name;
char MinLen;
enum TokTypes type;
int val;
} Token;
/* Flags for the state of the "if" stack */
#define IF_TRUE 0
#define IF_FALSE 1
#define BEFORE_ELSE 0
#define AFTER_ELSE 2
#define IF_MASK 3
#define IF_TRUE_MASK 1
#define IF_ELSE_MASK 2
/* Flags for the DoSubst function */
#define NORMAL_MODE 0
#define CAL_MODE 1
#define QUOTE_MARKER 1 /* Unlikely character to appear in reminder */
/* Flags for disabling run */
#define RUN_CMDLINE 1
#define RUN_SCRIPT 2
/* Flags for the SimpleCalendar format */
#define SC_AMPM 0 /* Time shown as 3:00am, etc. */
#define SC_MIL 1 /* 24-hour time format */
#define SC_NOTIME 2 /* Do not display time in SC format. */